import Vue from 'vue'
import VueRouter from 'vue-router'
const Index = () => import('@/views/Index.vue')
const Login = () => import('@/components/Login.vue')
const WorkbenchIndex = () => import('@/views/workbench/WorkbenchIndex.vue')
const ContractIndex = () => import('@/views/contract/ContractIndex.vue')
const ProjectIndex = () => import('@/views/project/ProjectIndex.vue')
const NeedIndex = () => import('@/views/need/NeedIndex.vue')
const FlawIndex = () => import('@/views/flaw/FlawIndex.vue')
const PomIndex = () => import('@/views/pom/PomIndex.vue')
// const ContractBoard = () => import('@/views/contract/contractBoard/ContractBoard.vue')
// const Client = () => import('@/views/contract/client/Client.vue')
// const NewContract = () => import('@/views/contract/newContract/NewContract.vue')
// const WeeklyNewspaper = () => import('@/views/contract/weeklyNewspaper/WeeklyNewspaper.vue')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/index',
    component: Index,
    children: [
      {
        path: '/workbench',
        component: WorkbenchIndex
      },
      {
        path: '/contract',
        component: ContractIndex
        // childrenren: [
        //   {
        //     path: '/contractBoard',
        //     component: ContractBoard
        //   },
        //   {
        //     path: '/client',
        //     component: Client
        //   },
        //   {
        //     path: '/newContract',
        //     component: NewContract
        //   },
        //   {
        //     path: '/weeklyNewspaper',
        //     component: WeeklyNewspaper
        //   }
        // ]
      },
      {
        path: '/project',
        component: ProjectIndex
      },
      {
        path: '/need',
        component: NeedIndex
      },
      {
        path: '/flaw',
        component: FlawIndex
      },
      {
        path: '/pom',
        component: PomIndex
      }
    ]
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
